/*Copyright ©2015 TommyLemon(https://github.com/TommyLemon)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.*/

package com.nhc.model;

import com.astrob.model.LonLat;

import zuo.biao.library.base.BaseModel;

public class DJZParamInfo extends BaseModel {

    private static final long serialVersionUID = 1L;

    private String name1 = "";
    private String name2 = "";
    private double lon = 0.0;
    private double lat = 0.0;
    private double N = 0.0;//北坐标
    private double E = 0.0;//东坐标

    /**
     * 默认构造方法，JSON等解析时必须要有
     */
    public DJZParamInfo() {
        //default
    }

    public DJZParamInfo(String name1, String name2, LonLat ll, LonLat ne) {
        this.name1 = name1;
        this.name2 = name2;
        setLL(ll);
        setNE(ne);
    }

    public void setNE(LonLat ne) {
        if (ne != null) {
            N = ne.GetLon();
            E = ne.GetLat();
        }
    }

    public void setLL(LonLat ll) {
        if (ll != null) {
            lon = ll.GetLon();
            lat = ll.GetLat();
        }
    }

    public LonLat getLL() {
        return new LonLat(lon, lat);
    }

    public String getName1() {
        return name1;
    }

    public void setName1(String name1) {
        this.name1 = name1;
    }

    public String getName2() {
        return name2;
    }

    public void setName2(String name2) {
        this.name2 = name2;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public double getN() {
        return N;
    }

    public void setN(double n) {
        N = n;
    }

    public double getE() {
        return E;
    }

    public void setE(double e) {
        E = e;
    }

    @Override
    protected boolean isCorrect() {//根据自己的需求决定，也可以直接 return true
        return id > 0;// && StringUtil.isNotEmpty(phone, true);
    }

}
